/*
 * Created by LiuYou on 2020/12/23.
 *
 */

#ifndef OPERATINGSYSTEM_PCB_HPP
#define OPERATINGSYSTEM_PCB_HPP


#include <string>
#include <ostream>
#include "ProcessStatus.hpp"

class Pcb {
public:
    friend std::ostream& operator<<(std::ostream& os, const Pcb& pcb);

    explicit Pcb(std::string name, int needExecutionTime = 0, ProcessStatus processStatus = ProcessStatus::BLOCKED,
                 int priorityNum = 0, int executionCount = 0, int executedTimeOnCpu = 0, int timeSlice = 2,
                 Pcb* next = nullptr);

    const std::string& getName() const;

    ProcessStatus getProcessStatus() const;

    int getPriorityNum() const;

    int getNeedExecutionTime() const;

    int getExecutionCount() const;

    int getExecutedTimeOnCpu() const;

    int getTimeSlice() const;

    Pcb* getNext() const;

private:
    std::string name;
    ProcessStatus processStatus;
    int priorityNum;
    int needExecutionTime;
    int executionCount;
    int executedTimeOnCpu;
    int timeSlice;
    Pcb* next;
};


#endif //OPERATINGSYSTEM_PCB_HPP
